/**
 * Generali Solutions d'assurances - Tous droits réservés &copy; 2007 - 2010
 */

package fr.generali.accueilclient.opt.detaildossier.builder;

import java.util.Date;

import fr.generali.accueilclient.opt.detaildossier.om.IDateRangeDetailDossier;
import fr.generali.accueilclient.opt.detaildossier.om.impl.DTODateRangeDetailDossier;

/**
 * @author Holmes Kelly
 */
public class DTODateRangeDetailDossierBuilder extends
                DTODateRangeDetailDossierBuilderBase<DTODateRangeDetailDossierBuilder> {

    /**
     * constructeur
     */
    public DTODateRangeDetailDossierBuilder() {
        super(new DTODateRangeDetailDossier());
    }

    /**
     * @return DTODateRangeDetailDossierBuilder
     */
    public static DTODateRangeDetailDossierBuilder dTODateRangeDetailDossier() {
        return new DTODateRangeDetailDossierBuilder();
    }

    /**
     * @return instance
     */
    public IDateRangeDetailDossier build() {
        return getInstance();
    }
}

/**
 * @author Holmes Kelly
 * @param <GeneratorT>
 */
class DTODateRangeDetailDossierBuilderBase<GeneratorT extends DTODateRangeDetailDossierBuilderBase<GeneratorT>> {

    /**
     * instance
     */
    private IDateRangeDetailDossier instance;

    /**
     * @param aInstance instance
     */
    protected DTODateRangeDetailDossierBuilderBase(IDateRangeDetailDossier aInstance) {
        instance = aInstance;
    }

    /**
     * @return instance
     */
    protected IDateRangeDetailDossier getInstance() {
        return instance;
    }

    /**
     * @param aValue start date
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildStartDate(Date aValue) {
        instance.setStartDate(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue end date
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildEndDate(Date aValue) {
        instance.setEndDate(aValue);

        return (GeneratorT ) this;
    }
}
